/**
 * 作者: wgx
 * 日期: 2024-11-01 15:22:29
 * 备注: 主线关卡配置表
 */
package com.motu.monstercity.server.game.commondata.fight;

import io.vertx.core.json.JsonObject;

public class StageModel {
    protected int id; // 数据库ID
    protected int mapId; // 章节id 从1开始连续增长
    protected int stageId; // 关卡id
    protected int type; // 类型 (类型（1普通关，消耗金币，2boss关，比拼战力）)
    protected long forces; // 过关条件 (type=1时配置值为消耗金币，type=2时配置值表示boss战力)
    protected String reward; // 奖励道具
    protected int isBoss; // 是否boss (1-boss关卡)
    protected int nodeNum; // 小节数量
    protected int event; // 触发事件
    protected long guardGoldNum; // 卫兵挂机奖励每分钟金币数量
    protected long guardExpNum; // 卫兵挂机奖励每分钟经验数量
    protected int guardGroupId; // 随机奖励的组id
    protected int guardCityExpNum; // 卫兵挂机奖励每分钟声望数量

    public StageModel() {
    }

    public StageModel(JsonObject obj) {
        id = obj.containsKey("id") ? obj.getInteger("id") : 0;
        mapId = obj.containsKey("map_id") ? obj.getInteger("map_id") : 0;
        stageId = obj.containsKey("stage_id") ? obj.getInteger("stage_id") : 0;
        type = obj.containsKey("type") ? obj.getInteger("type") : 0;
        forces = obj.containsKey("forces") ? obj.getLong("forces") : 0;
        reward = obj.containsKey("reward") ? obj.getString("reward") : "";
        isBoss = obj.containsKey("is_boss") ? obj.getInteger("is_boss") : 0;
        nodeNum = obj.containsKey("node_num") ? obj.getInteger("node_num") : 0;
        event = obj.containsKey("event") ? obj.getInteger("event") : 0;
        guardGoldNum = obj.containsKey("guard_gold_num") ? obj.getLong("guard_gold_num") : 0;
        guardExpNum = obj.containsKey("guard_exp_num") ? obj.getLong("guard_exp_num") : 0;
        guardGroupId = obj.containsKey("guard_group_id") ? obj.getInteger("guard_group_id") : 0;
        guardCityExpNum = obj.containsKey("guard_city_exp_num") ? obj.getInteger("guard_city_exp_num") : 0;
    }

    public int getId() {
        return id;
    }

    public int getMapId() {
        return mapId;
    }

    public int getStageId() {
        return stageId;
    }

    public int getType() {
        return type;
    }

    public long getForces() {
        return forces;
    }

    public String getReward() {
        return reward;
    }

    public int getIsBoss() {
        return isBoss;
    }

    public int getNodeNum() {
        return nodeNum;
    }

    public int getEvent() {
        return event;
    }

    public long getGuardGoldNum() {
        return guardGoldNum;
    }

    public long getGuardExpNum() {
        return guardExpNum;
    }

    public int getGuardGroupId() {
        return guardGroupId;
    }

    public int getGuardCityExpNum() {
        return guardCityExpNum;
    }

}
